package cn.third;

public class BookMessage {
    private String bookName;
    private String author;
    private  String press;
    private  int price;


    public BookMessage(){

    }

    public BookMessage(String bookName, String author, String press, int price) {
         this.setBookName(bookName);
         this.setAuthor(author);
         this.setPress(press);
         this.setPrice(price);
    }

    public String getBookName() {
        return bookName;
    }

    public void setBookName(String bookName) {
        this.bookName = bookName;
    }

    public String getAuthor() {
        return author;
    }

    public void setAuthor(String author) {
        this.author = author;
    }

    public String getPress() {
        return press;
    }

    public void setPress(String press) {
        this.press = press;
    }

    public int getPrice() {
        return price;
    }

    public void setPrice(int price) {
        if (price<10){
             price=20;
            System.out.println("价格太低 了,应该卖"+ price+"块钱");
        }
        this.price = price;
    }

    public void show(){
        String meg=String.format("书名%s,作者%s,出版社%s,价格%d",bookName,author,press, price);
        System.out.println(meg);
    }

}
